Repository navigation
factory-server: search OpenRouter models in the stage panel - #295
Merged
Merged
Conversation
With OpenRouter selected, the stage panel's model field is a search over the stored model list. Typing filters by a case-insensitive substring of the id or the name and offers the first 20 matches. The panel draws no chip per model and no CLI default chip, and the node reads Model required while the field is blank. Any typed id still saves. The list travels once per form in data-agent-models, so the browser makes no request to openrouter.ai. Switching agents redraws the field without a reload, on the Renovate agent card too. The field is a combobox of the results list while OpenRouter is selected and uses the native datalist for the other agents.
moonthebot
force-pushed
the
factory/job-138-pr-10
branch
from
November 27, 2026 22:01
90251e3 to
ecdadbe
Compare
Switching a stage from OpenRouter back to another agent restored the input's list attribute, but redrawModels had already looked the datalist up through that attribute and found none. It now finds the datalist by its stage id, so the other agent's options come back.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
OpenRouter lists hundreds of models, so a chip per model does not work. With OpenRouter selected, the stage panel's model field is now a search over the stored model list. Typing filters by a case-insensitive substring of the id or the name and lists the first 20 matches. Clicking a match, or ArrowDown and Enter, fills the field. Arrowing scrolls the active match into view.
The panel draws no chip, no "CLI default" chip and no datalist, and the node reads "Model required" while the field is blank. Any typed id still saves, for example one with a
:freesuffix. The hint reads "Search OpenRouter models." or "No OpenRouter model list is stored. Type a model id.".While OpenRouter is selected the input is a combobox of the results list, with
aria-expandedkept in sync andaria-activedescendantcleared when the list closes. Other agents keep the native datalist. The list goes into the form'sdata-agent-modelsJSON assearch, once per form, so the browser makes no request to openrouter.ai. Switching agents redraws the field without a reload, on the Renovate agent card too. Without JavaScript the page is a plain text field with the hint.Docs
docs/design.mdgets a "The stage panel" subsection in the OpenRouter section. The Agent registry and Settings layout rows are updated.Verification
cargo test -p factory-server --test dashboard --test pipeline_models_script: passed (641 and 7 tests).cargo clippy -p factory-server --all-targetsandcargo fmt --check: clean.npx playwright testonopenrouter-models,project-settingsandlocal-models: 37 passed. This includes a new case that arrows past the visible rows and checks the scroll, the combobox attributes and Escape.nix develop -c just e2erun: onlyproject-settings.spec.ts"a tabbed link in the settings sidebar scrolls into view with its whole outline" failed, and it also fails without this change.